import 'package:flutter/material.dart';
import '../demo/ui_demo.dart';
import 'ui_demo_drawer.dart';
import 'ui_demo_bottomNavigation.dart';
import 'ui_demo_listView.dart';
//void main() => runApp(new MyFirstApp());

class MyDemo extends StatelessWidget implements Demo {
   MyDemo(this.title);
  @override
   String title;
  @override
  Widget build(BuildContext context) {
    return new HomePage(title: this.title,);
  }
}

class HomePage extends StatelessWidget {
  String title;
  HomePage({this.title});
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 3,
      child: Scaffold(
        appBar: AppBar(
          title: Text(this.title),
          centerTitle: true,
          elevation: 0,
//          leading: IconButton(
//            icon: Icon(Icons.menu),
//            onPressed: () => debugPrint("menu button be pressed"),
//            tooltip: "navigator",
//          ),
          actions: <Widget>[
            IconSource("TabBar","03"),
          ],
          bottom: TabBar(
            unselectedLabelColor: Colors.black38,//未选中图标样式
            indicatorColor: Colors.white,//图标下划线颜色
            indicatorSize: TabBarIndicatorSize.tab,//图标下划线宽度
            indicatorWeight: 2.0,//图标下划线粗细
            tabs: <Widget>[
              Tab(icon: Icon(Icons.local_florist),text: "florist",),
              Tab(icon: Icon(Icons.local_convenience_store),text: "convenience",),
              Tab(icon: Icon(Icons.local_bar),text: "bar",)
            ],
          ),
        ),
        body: TabBarView(
          children: <Widget>[
            //Icon(Icons.local_florist,size: 128.0,color: Colors.black12,),
            ListViewDemo(),
            Icon(Icons.local_convenience_store,size:128.0,color:Colors.black12),
            Icon(Icons.local_bar,size:128.0,color:Colors.black12),
          ],
        ),
        drawer: DrawerDemo(),
        bottomNavigationBar: BottomNavigationDemo(),
      ),
    );
  }
}
